package per.mnxc.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import per.mnxc.common.R;
import per.mnxc.pojo.Files;
import per.mnxc.service.IFilesService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mnxc
 * @since 2022-11-26
 */
@Api(tags = "文件类相关接口")
@RestController
@RequestMapping("/files")
public class FilesController {
    @Autowired
    IFilesService filesService;

    @ApiOperation("文件分页查询")
    @GetMapping("/page")
    public R<IPage<Files>> page(int page,int pageSize){
        //1.分页构造器
        IPage<Files> pageInfo = new Page<>(page,pageSize);

        // //2.条件构造器
        // LambdaQueryWrapper<Files> lqw = new LambdaQueryWrapper<>();
        // lqw.like(path!=null,Files::getPath,)
        //3.查询数据
        filesService.page(pageInfo);
        return R.success(pageInfo);
    }
}

